iOS 9 SDK Development (for james shahan) by Chris Adamson & Janie Clayton

iOS 9 SDK Development (for james shahan) by Chris Adamson & Janie Clayton

Author:Chris Adamson & Janie Clayton
Language: eng
Format: epub
Tags: Pragmatic Bookshelf
Publisher: The Pragmatic Bookshelf, LLC (600247)


We call the NSJSONSerialization method JSONObjectWithData on line 10 to perform the JSON parsing of our data object. Since this is the method that can throw an error, we have to precede it with the try keyword.

On line 11 we pass in our options for JSONObjectWithData. The NSJSONReadingOptions type is a OptionSetType, which means it’s a Swift wrapper around a C bit-field, a scheme where values are powers of 2, so they can be inspected with bitwise mathematical operators. That’s great for C, but awkward in Swift, so in Swift 2.0, we get to treat them like Sets when we create them and inspect them, so to create an empty NSJSONReadingOptions, we pass in the empty set, [].



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.